﻿using System;
using System.Collections.Generic;



namespace Battle.Engine
{
    public class CommonUtil
    {

        public static string[] GetSplitString(string source, char split)
        {
            char[] sp = { split };
            string[] data = source.Split(sp, System.StringSplitOptions.RemoveEmptyEntries);
            return data;
        }
        
        public static int ConvertPlayerPositionIndexToFPId(int index)
        {
            if (index == 1)
            {
                return 3;
            }
            else if (index == 2)
            {
                return 7;
            }
            else if (index == 3)
            {
                return 9;
            }
            else if (index == 4)
            {
                return 13;
            }
            return 0;
        }


        public static long GetTimeNow()
        {
            //设备当前时间
            System.TimeSpan ts = System.DateTime.Now.Subtract(System.DateTime.Parse("1970-1-1"));
            return (long)ts.TotalMilliseconds;
        }
    }
}
